package com.storlead.security.service.impl;

import com.storlead.security.mapper.SysUserMapper;
import com.storlead.security.model.SysUser;
import com.storlead.security.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: Timo
 * @Date: 2019/3/15 09:43
 * @Description: 管理后台用户服务接口实现类
 */
@Slf4j
@Service
public class SysUserServiceImpl implements SysUserService {

    @Resource
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser findById(Integer sysUserId) {
        SysUser sysUserWhere = new SysUser();
        sysUserWhere.setSysUserId(sysUserId);
        return sysUserMapper.queryUser(sysUserWhere);
    }

    @Override
    public SysUser findByUserName(String userName) {
        SysUser sysUserWhere = new SysUser();
        sysUserWhere.setUserName(userName);
        return sysUserMapper.queryUser(sysUserWhere);
    }
}
